package com.mobileares.midp.widgets.client.utils;

import com.google.gwt.user.client.rpc.IsSerializable;
import com.mobileares.midp.widgets.model.PaginationModelDto;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: Tom
 * Date: 2011-3-31
 * Time: 21:46:52
 * To change this template use File | Settings | File Templates.
 */
public class PersonDto implements IsSerializable {
    private Long id;
    private String name;
    private String sex;
    private Date birthDay;
    private String address;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Date getBirthDay() {
        return birthDay;
    }

    public void setBirthDay(Date birthDay) {
        this.birthDay = birthDay;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PersonDto personDto = (PersonDto) o;


        if (name != null ? !name.equals(personDto.name) : personDto.name != null) return false;


        return true;
    }
   public static PaginationModelDto getPaginationTableData(int begin, int count) {
        List result = new ArrayList();
        for (int i = begin; i < count + begin; i++) {
            PersonDto map = new PersonDto();
            map.setName("李" + i);
            map.setSex("女");
            map.setAddress("天津");
            result.add(map);
        }
        PaginationModelDto dto = new PaginationModelDto(result, 1000);
        return dto;
    }

}

